# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=gtk-layer-shell
pkgver=0.9.0
pkgrel=0
pkgdesc="Create panels and other desktop components in Wayland using the Layer Shell protocol"
url="https://github.com/wmww/gtk-layer-shell"
arch="all"
license="LGPL-3.0-or-later AND MIT"
makedepends="
	gobject-introspection-dev
	gtk+3.0-dev
	meson
	vala
	wayland-dev
	"
checkdepends="
	font-dejavu
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-demo"
source="$pkgname-$pkgver.tar.gz::https://github.com/wmww/gtk-layer-shell/archive/v$pkgver.tar.gz"
options="!check" # tests fail

build() {
	abuild-meson \
		-Db_lto=true \
		-Dexamples=true \
		-Ddocs=false \
		-Dtests=true \
		. output
	meson compile -C output
}

check() {
	XDG_RUNTIME_DIR="$(mktemp -d -p "$builddir")" \
		xvfb-run -a \
		meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

demo() {
	pkgdesc="Demo of GTK Layer Shell"

	amove usr/bin/gtk-layer-demo
}

sha512sums="
38179dd83a0828740ca8e2cc27fe3708f61107e88246644745da6c300da03ce04b17dd7117087946a68401a43176a599bdb98ed50936602d2b2540449c0e9066  gtk-layer-shell-0.9.0.tar.gz
"
